import React from "react";
import './form.css'
import { Input } from "antd-mobile";
import Icon from "../Icon";
import icon_proof_contact_picker from "@/assets/icon_proof_contact_picker.png"

export default function FormSelectContact({ title, list, showIcon, onSelectedDataClick, ...rest }) {

    const onHandleClick = () => {
        onSelectedDataClick && onSelectedDataClick();
    }

    return (
        <div className="formContent">
            <span className="formTitle">{title}</span>
            <div className="formValueContent" onClick={() => { onHandleClick() }}>
                <Input className="formValue"  {...rest} readOnly={true} />
                {(showIcon === true) && <Icon picUrl={icon_proof_contact_picker} onItemClick={() => { onHandleClick() }}></Icon>}
            </div>
            <div className="formSplitLine" hidden></div>
        </div>
    )
}

